#!/bin/sh

deploy_curl_pod() {
  local NAMESPACE="${1:-default}"

  cat << EOF | kubectl apply -f -
  apiVersion: v1
  kind: Pod
  metadata:
    name: curl
    namespace: $NAMESPACE
  spec:
    containers:
    - image: ongres/kubectl:v1.30.1-build-6.32
      command: [ "sh", "-c", "while true; do sleep 300; done" ]
      imagePullPolicy: IfNotPresent
      name: busybox
    restartPolicy: Always
    terminationGracePeriodSeconds: 0
EOF

  wait_until eval 'kubectl get pods -n "$NAMESPACE" curl | grep Running | grep 1/1'
}

